import request from "@/utils/request.js"
// 创建提问
export function addQues(data) {
	return request.Request({
		url: '/kwkd/QaQuestion/add',
		method: 'POST',
		data
	});
}
// 创建回答
export function addAnswer(data) {
	return request.Request({
		url: '/kwkd/QaAnswer/add',
		method: 'POST',
		data
	});
}
// 创建评论
export function addComment(data) {
	return request.Request({
		url: '/kwkd/QaComment/add',
		method: 'POST',
		data
	});
}
// 删除提问
export function delQues(data) {
	return request.Request({
		url: '/kwkd/QaQuestion/deleteMyQuestion?id=' + data.id,
		method: 'DELETE',
		data
	});
}
// 删除回答
export function delAnswer(data) {
	return request.Request({
		url: '/kwkd/QaAnswer/deleteMyAnswer?id=' + data.id,
		method: 'DELETE',
		data
	});
}
// 删除评论
export function delComment(data) {
	return request.Request({
		url: '/kwkd/QaComment/deleteMyComment?id=' + data.id,
		method: 'DELETE',
		data
	});
}
// 提问详情
export function quesDetail(data) {
	return request.Request({
		url: '/kwkd/QaQuestion/public/detail',
		method: 'GET',
		data
	});
}
// 回答详情
export function answerDetail(data) {
	return request.Request({
		url: '/kwkd/QaAnswer/public/detail',
		method: 'GET',
		data
	});
}
// 提问详情的回答列表
export function answerListByQues(data) {
	return request.Request({
		url: '/kwkd/QaAnswer/public/query',
		method: 'POST',
		data
	});
}
// 评论列表
export function commendList(data) {
	return request.Request({
		url: '/kwkd/QaComment/public/query',
		method: 'POST',
		data
	});
}
// 创建小组
export function addGroup(data) {
	return request.Request({
		url: '/kwkd/team/add',
		method: 'POST',
		data
	});
}
// 小组详情
export function groupDetail(data) {
	return request.Request({
		url: '/kwkd/team/public/detail',
		method: 'GET',
		data
	});
}
// 修改小组信息
export function editGroupInfo(data) {
	return request.Request({
		url: '/kwkd/team/edit',
		method: 'PUT',
		data
	});
}

// 小组成员
export function groupMember(data) {
	return request.Request({
		url: '/kwkd/teamUser/public/query',
		method: 'POST',
		data
	});
}
// 小组动态
export function groupTrends(data) {
	return request.Request({
		url: '/kwkd/recommend/public/recommendTeamDynamicQuestionAnswerNote',
		method: 'POST',
		data
	});
}

// 加入小组
export function joinGroup(data) {
	return request.Request({
		url: '/kwkd/teamUser/add',
		method: 'POST',
		data
	});
}
// 设置小组管理员
export function setMemberManage(data) {
	return request.Request({
		url: '/kwkd/teamUser/settingAdmin',
		method: 'PUT',
		data
	});
}
// 小组成员操作自己的信息
export function operMember(data) {
	return request.Request({
		url: '/kwkd/teamUser/edit',
		method: 'PUT',
		data
	});
}
// 审核成员
export function agreeMember(data) {
	return request.Request({
		url: '/kwkd/teamUser/audit',
		method: 'PUT',
		data
	});
}
// 删除成员
export function delMember(data) {
	return request.Request({
		url: '/kwkd/teamUser/excludeMembers?teamId=' + data.teamId + '&createUserId=' + data.createUserId,
		method: 'DELETE',
		data
	});
}

// 添加、编辑公告
export function addNotice(data) {
	return request.Request({
		url: '/kwkd/teamAnnouncement/addOrUpdate',
		method: 'POST',
		data
	});
}
// 公告列表
export function noticeList(data) {
	return request.Request({
		url: '/kwkd/teamAnnouncement/public/query',
		method: 'POST',
		data
	});
}
// 删除公告
export function delNotice(data) {
	return request.Request({
		url: '/kwkd/teamAnnouncement/delete?id=' + data.id,
		method: 'DELETE',
		data
	});
}
// 创建活动
export function addActivity(data) {
	return request.Request({
		url: '/kwkd/teamActivity/add',
		method: 'POST',
		data
	});
}
// 下架活动
export function offlineActivity(data) {
	return request.Request({
		url: '/kwkd/teamActivity/takeDown?teamId=' + data.teamId + '&teamActivityId=' + data.teamActivityId,
		method: 'DELETE',
		data
	});
}
// 关联活动
export function connectAct(data) {
	return request.Request({
		url: '/kwkd/teamActivity/relationTeam',
		method: 'POST',
		data
	});
}
// 活动详情
export function actDetail(data) {
	return request.Request({
		url: '/kwkd/teamActivity/public/detail',
		method: 'GET',
		data
	});
}
// 活动修改
export function editActivityInfo(data) {
	return request.Request({
		url: '/kwkd/teamActivity/edit',
		method: 'PUT',
		data
	});
}
// 活动成员
export function activityMember(data) {
	return request.Request({
		url: '/kwkd/teamActivityUser/public/query',
		method: 'POST',
		data
	});
}
// 加入活动
export function joinActivity(data) {
	return request.Request({
		url: '/kwkd/teamActivityUser/add',
		method: 'POST',
		data
	});
}
// 关联小组
export function connectGroup(data) {
	return request.Request({
		url: '/kwkd/teamActivity/relationActivity',
		method: 'POST',
		data
	});
}
// 活动下的小组列表
export function activityGroup(data) {
	return request.Request({
		url: '/kwkd/team/public/activityTeam',
		method: 'POST',
		data
	});
}
// 创建任务
export function addTask(data) {
	return request.Request({
		url: '/kwkd/teamActivityTask/add',
		method: 'POST',
		data
	});
}
// 活动下的任务列表
export function activityTask(data) {
	return request.Request({
		url: '/kwkd/teamActivityTask/public/query',
		method: 'POST',
		data
	});
}
// 任务详情
export function taskDetail(data) {
	return request.Request({
		url: '/kwkd/teamActivityTask/public/detail',
		method: 'GET',
		data
	});
}
// 创建笔记
export function addTaskNote(data) {
	return request.Request({
		url: '/kwkd/notes/add',
		method: 'POST',
		data
	});
}
// 笔记列表
export function noteList(data) {
	return request.Request({
		url: '/kwkd/notes/public/query',
		method: 'POST',
		data
	});
}
// 删除笔记
export function delTaskNote(data) {
	return request.Request({
		url: '/kwkd/notes/deleteMyNotes?id=' + data.id,
		method: 'DELETE',
		data
	});
}
// 笔记详情
export function noteDetail(data) {
	return request.Request({
		url: '/kwkd/notes/public/detail',
		method: 'GET',
		data
	});
}
// 评论笔记
export function addNoteCommend(data) {
	return request.Request({
		url: '/kwkd/notesComment/add',
		method: 'POST',
		data
	});
}
// 笔记评论列表
export function noteCommendList(data) {
	return request.Request({
		url: '/kwkd/notesComment/public/query',
		method: 'POST',
		data
	});
}
// 删除笔记评论
export function delNoteCommend(data) {
	return request.Request({
		url: '/kwkd/notesComment/deleteMyNotesComment?id=' + data.id,
		method: 'DELETE',
		data
	});
}
// 任务下的问答列表
export function taskQuesList(data) {
	return request.Request({
		url: '/kwkd/recommend/public/recommendTaskQuestionAnswer',
		method: 'POST',
		data
	});
}
// 结束任务
export function endTask(data) {
	return request.Request({
		url: '/kwkd/teamActivityTask/finished',
		method: 'PUT',
		data
	});
}
// 创建qq群
export function addQQ(data) {
	return request.Request({
		url: '/kwkd/userGroup/add',
		method: 'POST',
		data
	});
}
// 删除qq群
export function delQQ(data) {
	return request.Request({
		url: '/kwkd/userGroup',
		method: 'GET',
		data
	});
}
// qq群详情
export function qqDetail(data) {
	return request.Request({
		url: '/kwkd/userGroup/queryById',
		method: 'GET',
		data
	});
}
// 修改qq群
export function editQQ(data) {
	return request.Request({
		url: '/kwkd/userGroup/update',
		method: 'POST',
		data
	});
}





// ------------ 知识体系 ------------ // 

// 分页查询知识树  私有
export function treeQuery(data) {
	return request.Request({
		url: '/kwkd/TreePrivate/query',
		method: 'POST',
		data
	});
}

// 保存知识树  私有
export function treeSave(data) {
	return request.Request({
		url: '/kwkd/TreePrivate/save',
		method: 'POST',
		data
	});
}

// 修改知识树  私有
export function treeUpdate(data) {
	return request.Request({
		url: '/kwkd/TreePrivate/update',
		method: 'POST',
		data
	});
}

// 查询知识树  私有
export function treeGet(id) {
	return request.Request({
		url: '/kwkd/TreePrivate/' + id,
		method: 'GET',
	});
}

// 查询知识树  公有
export function TreePublicQuery(data) {
	return request.Request({
		url: '/kwkd/TreePublic/query',
		method: 'POST',
		data
	});
}

// 根据查询知识树  私有
export function findTreePrivate(id) {
	return request.Request({
		url: `/kwkd/TreePrivate/${id}`,
		method: 'GET',
	});
}

//知识表管理  删除
export function KnowledgeDel(ids) {
	return request.Request({
		url: "/kwkd/Knowledge/",
		method: 'DELETE',
		query: {
			ids
		}
	})
}

//知识表管理  新增知识表
export function KnowledgeAdd(data) {
	return request.Request({
		url: "/kwkd/Knowledge/addBatch",
		method: 'POST',
		data
	})
}

//知识表管理  查询知识表
export function KnowledgeQuery(data) {
	return request.Request({
		url: "/kwkd/Knowledge/query",
		method: 'POST',
		data
	})
}

//知识表管理  修改知识表
export function KnowledgeUpdate(data) {
	return request.Request({
		url: "/kwkd/Knowledge/update",
		method: 'POST',
		data
	})
}

//知识表管理  通过ID查询知识表
export function KnowledgeQueryId(id) {
	return request.Request({
		url: "/kwkd/Knowledge/" + id,
		method: 'GET',
	})
}

export function queryQuestion(data) {
	return request.Request({
		url: '/kwkd/Knowledge/queryQuestion',
		method: 'POST',
		data
	});
}
